import request from '@/utils/request'

/**
 *  查询菜单树
 * @returns {*}
 */
export const findMenuTree = () => {
  return request({
    url: `/user/system/sysMenu/findMenuTree`,
    method: 'GET',
  })
}

/**
 *  修改菜单
 * @param sysMenu
 * @returns {*}
 */
export const doUpdateMenu = sysMenu => {
  return request({
    url: `/user/system/sysMenu/updateMenu`,
    data: sysMenu,
    method: 'put',
  })
}

/**
 *  添加菜单
 * @param sysMenu
 * @returns {*}
 */
export const doAddMenu = sysMenu => {
  return request({
    url: `/user/system/sysMenu/addMenu`,
    data: sysMenu,
    method: 'post',
  })
}

/**
 *  删除菜单
 * @param id
 * @returns {*}
 */
export const doDeleteMenu = id => {
  return request({
    url: `/user/system/sysMenu/deleteMenu/${id}`,
    method: 'delete',
  })
}
